// ==============================================================================================
// OfficeMenuTreeNode.cs
//
// Created by: NI, 2007.03.28
// Revised by: NI, 2007.11.23
// ==============================================================================================
using System.Windows.Forms;
using RibbonExplorer.Entities;
using RibbonExplorer.InfoPanel;

namespace RibbonExplorer.Tree
{
  // ==============================================================================================
  /// <summary>
  /// This tree node represents the Office menu.
  /// </summary>
  // ==============================================================================================
  public class OfficeMenuTreeNode : GroupTreeNode
  {
    #region Lifecycle methods

    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Creates a tree node instance based on the Office application information.
    /// </summary>
    /// <param name="menuGroup">Office menu instance</param>
    // --------------------------------------------------------------------------------------------
    public OfficeMenuTreeNode(OfficeMenu menuGroup)
      : base(menuGroup)
    {
      ImageKey = "OfficeMenu";
      SelectedImageKey = ImageKey;
    }

    #endregion

    #region IInfoPanelSupport implementation

    // --------------------------------------------------------------------------------------------
    /// <summary>
    /// Creates an infopanel instance for this tree node type.
    /// </summary>
    /// <param name="node">Tree node instance</param>
    /// <param name="navigationService">Navigation service instance</param>
    /// <returns>
    /// User control instance
    /// </returns>
    // --------------------------------------------------------------------------------------------
    public override UserControl GetInfoPanelInstance(TreeNode node, INavigationSupport navigationService)
    {
      GenericInfoPanel control = new GenericInfoPanel(navigationService, node);
      control.HeaderText = node.Text;
      return control;
    }

    #endregion

  }
}
